package com.example.demoshiro.controller;

import com.example.democommon.contasant.CommonConstant;
import com.example.democommon.tools.Result;
import com.example.demoshiro.tools.JwtUtil;
import com.example.demoshiro.tools.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;

/**
 * <p>
 * 专门处理FilterError的控制器
 * </p>
 *
 * @author ross zhang
 * @version 1.0
 * @PackageName demo-one
 * @Package com.example.demoshiro.controller
 * @since 2022/4/17 10:59
 */
@RestController
@RequestMapping("/common")
public class FilterErrorController {
    @Autowired
    private RedisUtil redisUtil;

    @RequestMapping(path = "/unauthorized/{message}")
    public Result<?> unauthorized(@PathVariable String message) {
        return new Result<>().error401(message);
    }
}
